<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
<SCRIPT LANGUAGE = "JavaScript">
    function checkId(){
    	if(f.user_id.value==""){
	    	alert("please insert the user id");
    		return;
    	}
     }
     function insert(){
    	 checkId();
    	 f.action="do_insert.do";
    	 f.submit();	   	 
     }
     function update(){
    	 checkId();
    	 f.action="do_update.do";
    	 f.submit();	   	 
     }
</SCRIPT>
</head>
<body>
<form name="f" method="post">
<table>
<%
	String job= (String)request.getAttribute("job");
	if(job=="update"){

%>
[Update]
only user id can be changed.	
<br><br>
Current info
<br>
id: ${obj.id}
<br>
user id: ${obj.user_id}
<br>
access time: ${obj.acc_date} 	
<%			
} else{
%>
[Insert]
only user id can be inserted.
<br>
Other infomation will be generated automatically.
<%}%>
<br>
<br>
<tr>
	<td>user id: </td>
	<td><input type=text name="user_id"/><input type=hidden name="id" value="${obj.id}" /></td>

</tr>
</table>
<%if(job=="update"){ %>
<input type="button" onclick="update();" value="update"/>
<%}else{ %><input type="button" onclick="insert();" value="insert"/>
<%} %>
</form>
</body>
</html>